package com.zcs.shardingjdbc.controller;
import com.zcs.shardingjdbc.entity.LouDong;
import com.zcs.shardingjdbc.service.LouDongService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author zcs
 */
@RestController
public class LouDongController {
	
	@Resource
	private LouDongService louDongService;
	
	@GetMapping("/ld/add")
	public Object add() {
		for (long i = 0; i < 10; i++) {
			LouDong louDong = new LouDong();
			louDong.setCity("深1");
			louDong.setRegion("宝1");
			louDongService.save(louDong);
		}
		return "success";
	}
	
}
